package com.sun.controller;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.sun.common.MsResult;
import com.sun.pojo.UmsMemberLevel;
import com.sun.service.IUmsMemberLevelService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 会员等级表 前端控制器
 * </p>
 *
 * @author 妙妙屋
 * @since 2022-01-04
 */
@RestController
@RequestMapping("/memberLevel")
public class UmsMemberLevelController {
    @Autowired
    private IUmsMemberLevelService umsMemberLevelService;
    @GetMapping("/list")
    public MsResult list(Long defaultStatus){
        //根据默认状态，查找会员级别
        QueryWrapper<UmsMemberLevel> qr = new QueryWrapper<>();
        qr.eq("default_status",defaultStatus);
        List<UmsMemberLevel> list = umsMemberLevelService.list(qr);
        return MsResult.isOkData(list);
    }
}

